<?php

/**
 * Feedback form.
 *
 * @package    rrtk
 * @subpackage form
 * @author     irh
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class FeedbackForm extends BaseFeedbackForm {
    public function configure() {
        $this->setWidgets(array(
            'user_name'     => new sfWidgetFormInputText(),
            'email'         => new sfWidgetFormInputText(),
            'text'          => new sfWidgetFormTextarea()
        ));
        
        $this->setValidators(array(
            'user_name'     => new sfValidatorString(array('max_length' => 50, 'required' => false)),
            'email'         => new sfValidatorEmail(array('required' => false), array('invalid' => 'Email is invalid')),
            'text'          => new sfValidatorString()
        ));
        
        $this->setHints(array(
            'user_name' => 'введите имя',
            'email' => 'введите e-mail',
            'text' => 'введите текст',
        ));
        
        $this->widgetSchema->setNameFormat('feedback[%s]');

        $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

        $this->setupInheritance();
    }
}
